function commonSBoxChange(target, mode){
	var commonSBoxBefore = $(document).find("#"+target);
	commonSBoxBefore.after('<div class="commonSelectBox" id="commonSBox'+target+'"><div class="nowSelected"></div><ul class="selectList"></ul></div>');
	var commonSBoxAfter = $('#commonSBox'+target);
	commonSBoxBefore.hide();
	commonSBoxBefore.find('option').each(function() {
		$('<li>'+$(this).text()+'</li>').appendTo(commonSBoxAfter.children('.selectList'));
	});
	commonSBoxAfter.children('.nowSelected').html( commonSBoxBefore.children("option:selected").text() );
	commonSBoxAfter.click(function(){
		if(commonSBoxAfter.children('.selectList').css('display') == 'none'){
			$(this).children('.selectList').stop().slideDown('fast');
			bindEvent()
		}else{
			$(this).children('.selectList').stop().slideUp('fast');
			$(document).unbind();
		}
	});
	
	function bindEvent(){
		$(document).click(function(e){
			if($(e.target).parent().parent().attr("class") != commonSBoxAfter.attr("class") && $(e.target).parent().attr("class") != commonSBoxAfter.attr("class") && $(e.target).attr("class") != commonSBoxAfter.attr("class")){
				commonSBoxAfter.children('.selectList').stop().slideUp('fast');
				$(this).unbind();
			}
		});
	}
		
	commonSBoxAfter.find('li').click(function(){
		var textValue = $(this).text();
		commonSBoxBefore.find('option').each(function() {
			if ($(this).text() == textValue) {
				if(mode == 'move') {
					if ($(this).val()) {
						location.href = $(this).val();
						return;
					}
				}
				$(this).attr('selected', 'selected');
			}
		});
		commonSBoxAfter.children('.nowSelected').text($(this).text());
	});
}